<div class="waypoint container contact">
    <div class="row">

        <div class="col-md-12">
            <h2 class="page-title">Avaliações Pendentes</h2>
        </div>
        
        <div class="col-md-12">
            <ol class="breadcrumb">
                <li><a href="<?php echo $this->url(array('controller' => 'admin', 'action' => 'index'))?>">Admin</a></li>
                <li>Avaliações Pendentes</li>
            </ol>
        </div>
        
        <?php if (count($this->evaluations) == 0) { ?>
            <div class="col-md-1"></div>
            <div class="col-md-10">
                <div class="alert alert-info alert-dismissable" style="width: 100%; text-align: center">
                     <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                     <strong>Parabéns! </strong>
                     Nenhuma nova avaliação para moderar no momento.
                </div>
            </div>
            <br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
        <?php } ?>
        
        <?php foreach ($this->evaluations AS $eval) { 
                    if (($eval['actual'] == 1) && ($eval['gender'] == 'm')) {
                        $atual = "funcionário";
                        $gender = 'male';
                    } elseif (($eval['actual'] == 1) && ($eval['gender'] == 'f')) {
                        $atual = "funcionária";
                        $gender = 'female';
                    } elseif (($eval['actual'] == 0) && ($eval['gender'] == 'f')) {
                        $atual = "ex-funcionária";
                        $gender = 'female';
                    } elseif (($eval['actual'] == 0) && ($eval['gender'] == 'm')) {
                        $atual = "ex-funcionário";
                        $gender = 'male';
                    }
        ?>
            <div class="row">
                <div class="col-md-1"></div>
                <div class="col-md-10">
                    <div class="panel panel-primary">
                        <div class="panel-heading">
                            <?php echo $eval['function']; ?> na <?php echo $eval['company_name']; ?>
                        </div>
                        <div class="panel-body">
                            <div class="col-md-2">
                                <div class="row"><img style="margin-top: 8px;" width="100" height="100" src="<?php echo $this->baseUrl() . '/img/'.$gender.'.png' ?>"></div>
                                <div class="row"><a href="<?php echo $eval['user_link']; ?>" target="_new"><?php echo $eval['user']; ?></a></div>
                            </div>
                            <div class="row">
                                <div class="col-md-5">
                                    <span style="font-weight: bolder; margin-left: 5px; margin-right: 5px;">Localização: </span>
                                    <?php echo $eval['location']; ?>
                                </div>
                                <div class="col-md-2">
                                    <span style="font-weight: bolder; margin-left: 5px; margin-right: 5px;">Ano: </span>
                                    <?php echo $eval['year']; ?>
                                </div>
                                <div class="col-md-5">
                                    <span style="font-weight: bolder; margin-left: 5px; margin-right: 5px;">Função: </span> 
                                    <?php echo $eval['function']; ?>
                                </div>
                                <div class="col-md-4">
                                    <span style="font-weight: bolder; margin-left: 5px; margin-right: 5px;">Faixa Etaria: </span>
                                    <?php echo $eval['age']; ?>
                                </div>
                                <div class="col-md-5">
                                    <span style="font-weight: bolder; margin-left: 5px; margin-right: 5px;">Condição: </span> 
                                    <?php echo $atual; ?>
                                </div>
                                <div class="col-md-4">
                                    <span style="font-weight: bolder; margin-left: 5px; margin-right: 5px;">Recomenda: </span>
                                    <?php if ($eval['recomend'] == 1) echo 'Sim'; ?><?php if ($eval['recomend'] == 0) echo 'Não'; ?>
                                </div>
                                <div class="col-md-5">
                                    <span style="font-weight: bolder; margin-left: 5px; margin-right: 5px;">Area: </span> 
                                    <?php echo $eval['area']; ?>
                                </div>
                                <div class="col-md-4">
                                    <span style="font-weight: bolder; margin-left: 5px; margin-right: 5px;">Avaliação: </span>
                                    <span class="rate" data-score="<?php echo $eval['star_rate']; ?>"> </span>
                                </div>
                                <div class="col-md-5">
                                    <span style="font-weight: bolder; margin-left: 5px; margin-right: 5px;">Empresa: </span> 
                                    <a href="<?php echo $this->url(array('controller' => 'evaluation', 'action' => 'detalhes', 'company' => $eval['company_friendly_name'])); ?>"> <?php echo $eval['company_name']; ?> </a>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-10">
                                    <span style="font-weight: bolder; margin-right: 10px;">Opinião: </span>
                                    <?php echo $eval['opinion']; ?>
                                </div>
                            </div>
                        </div>
                        <div class="panel-footer">
                            <div class="row">
                                <div class="col-md-9"><span style="color: #C9CAD6">em <?php echo date("d/m/Y H:i", strtotime($eval['date'])) ?></span></div>
                                <div class="col-md-3" >
                                    <a href="<?php echo $this->url(array('controller' => 'admin', 'action' => 'aprovar-avaliacoes', 'evaluation' => $eval['id'], 'aproved' => 0))?>" class="btn btn-danger"> <span class="fa fa-ban"></span> Rejeitar </a>
                                    <a href="<?php echo $this->url(array('controller' => 'admin', 'action' => 'aprovar-avaliacoes', 'evaluation' => $eval['id'], 'aproved' => true))?>" class="btn btn-success"> <span class="fa fa-check"></span> Aprovar</a>
                                </div>
                            </div>
                            
                        </div>
                    </div>
                </div>
            </div>
        <?php } ?>
        
        
        
        
        
           
        
        
        
        
        

    </div><!-- end .row -->
</div><!-- end section -->
<script type="text/javascript">
    $( document ).ready(function() {
        $('label').tooltip();
        $(".rate").raty({ path: '<?php echo $this->baseUrl() . "/img/stars/" ?>', size: 22, readOnly: true, halfShow : true, score: function() {return $(this).attr('data-score');}});
    });
</script>